package com.duan.web;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.duan.dao.Daq_dbmsDao;
import com.duan.model.Comdqueue;
import com.duan.model.Datainfo;
import com.duan.util.Daq_dbmsUtil;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class ComdServlet extends HttpServlet{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		this.doPost(request, response);
	}
	protected void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {
		response.setCharacterEncoding("utf-8");
		int S_Id = Integer.parseInt(request.getParameter("S_Id"));
		System.out.println(S_Id);	
		Daq_dbmsDao dao = new Daq_dbmsDao();
		Comdqueue comdqueue = dao.getLastComdqueueByS_Id(S_Id);
		String C_Content = comdqueue.getC_Content();
		System.out.println(C_Content);
		PrintWriter out = response.getWriter();
		out.println(C_Content);
	}
}